package com.hotel.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hotel.entity.Reservation;
import com.hotel.dto.ReservationDTO;
import com.hotel.vo.ReservationVO;

import java.util.List;
import java.util.Map;

/**
 * 预订服务接口
 */
public interface ReservationService extends IService<Reservation> {
    
    /**
     * 分页查询预订列表
     */
    Page<ReservationVO> getReservationPage(int current, int size, String keyword, String status, String checkinDate, String checkoutDate);
    
    /**
     * 根据ID获取预订详情
     */
    ReservationVO getReservationById(Long id);
    
    /**
     * 创建预订
     */
    boolean createReservation(ReservationDTO reservationDTO);
    
    /**
     * 更新预订信息
     */
    boolean updateReservation(Long id, ReservationDTO reservationDTO);
    
    /**
     * 取消预订
     */
    boolean cancelReservation(Long id, String reason);
    
    /**
     * 确认预订
     */
    boolean confirmReservation(Long id);
    
    /**
     * 办理入住
     */
    boolean checkin(Long reservationId, Long roomId);
    
    /**
     * 办理退房
     */
    boolean checkout(Long reservationId);
    
    /**
     * 根据预订号查询预订
     */
    Reservation getReservationByNumber(String reservationNumber);
    
    /**
     * 根据客户信息查询预订
     */
    List<ReservationVO> getReservationsByCustomer(String customerName, String customerPhone);
    
    /**
     * 获取今日入住预订
     */
    List<ReservationVO> getTodayCheckinReservations();
    
    /**
     * 获取今日退房预订
     */
    List<ReservationVO> getTodayCheckoutReservations();
    
    /**
     * 获取预订统计信息
     */
    Map<String, Object> getReservationStats();
    
    /**
     * 获取预订趋势数据
     */
    List<Map<String, Object>> getReservationTrend(String startDate, String endDate);
    
    /**
     * 获取房间入住率统计
     */
    Map<String, Object> getOccupancyRate(String startDate, String endDate);
    
    /**
     * 延长住宿
     */
    boolean extendStay(Long reservationId, String newCheckoutDate);
    
    /**
     * 更换房间
     */
    boolean changeRoom(Long reservationId, Long newRoomId);
    
    /**
     * 获取即将到期的预订
     */
    List<ReservationVO> getExpiringReservations(int hours);
    
    /**
     * 批量确认预订
     */
    boolean batchConfirmReservations(List<Long> reservationIds);
    
    /**
     * 生成预订号
     */
    String generateReservationNumber();
}